home *** CD-ROM | disk | FTP | other *** search
- #include "exec/types.h"
- #include "graphics/gfxmacros.h"
- #include "intuition/intuition.h"
-
-
-
- struct IntuitionBase *IntuitionBase;
- struct Window *NoBorder;
- struct GfxBase *GfxBase;
- struct Screen *Scrn;
- struct IntuiMessage *mesg;
- struct RastPort *r;
- struct ViewPort *vp;
-
- #define MAXW 320 /* max width van window ! */
- #define MAXH 200 /* max height van window ! */
- #define HALFMAXH MAXH/2-1
-
- struct NewScreen NewScrn = {
- 0, 0, /* LeftEdge, TopEdge */
- 320,200, /* Width, Height */
- 5, /* Depth */
- 0, 1, /* DetailPen, BlockPen */
- NULL, /* ViewModes ... value of 0 = low resolution */
- CUSTOMSCREEN, /* Type of screen */
- NULL, /* Font to be used as default for this screen */
- NULL, /* DefaultTitle for its title bar */
- NULL, /* screens user-gadgets, always NULL, ignored */
- NULL }; /* address of custom bitmap for screen */
-
- struct NewWindow NewNoBorder = {
- 0, /* LeftEdge */
- 0, /* TopEdge */
- MAXW, MAXH, /* Width, Height of this window */
- -1, /* DetailPen */
- -1, /* BlockPen */
- MOUSEBUTTONS, /* IDCMP Flags */
- ACTIVATE|NOCAREREFRESH|BORDERLESS|GIMMEZEROZERO|BACKDROP,
- /* Window Flags: (see below for more info) */
- NULL, /* FirstGadget */
- NULL, /* CheckMark */
- NULL, /* Window title */
- NULL, /* Pointer to Screen if not workbench */
- NULL, /* Pointer to BitMap if a SUPERBITMAP window */
- 0, 0, /* minimum width, minimum height */
- 0,0, /* maximum width, maximum height */
- CUSTOMSCREEN /* type waarin window opend */
- };
-
-
- #define INTUITION_REV 0
- #define GRAPHICS_REV 0
-
-
-
- main()
- {
- ULONG mclass;
- SHORT len,einde,i,j,k,zijde,xnul,ynul;
-
-
-
- VOID OpenALL();
-
- OpenALL();
-
- if((Scrn = (struct Screen *) OpenScreen(&NewScrn)) == 0) exit(10);
-
- NewNoBorder.Screen = Scrn;
-
- if((NoBorder = (struct Window *) OpenWindow(&NewNoBorder)) == 0) exit(20);
-
- /* ======geen screentitel====== */
-
- ShowTitle(Scrn,0);
-
- /* ======definitie van RPort !====== */
-
- r=NoBorder->RPort;
- vp=ViewPortAddress(NoBorder);
-
-
- for(i=1;i<32;i++) SetRGB4(vp,i,i%16,0,16-i%16);
-
- SetRGB4(vp,0,0,0,0);
-
- /* init variabelen */
-
- zijde = 10;
-
- for(j=0;j<10;j++)
- {
- for(i=0;i<10;i++)
- {
- SetAPen(r,1+((i+j)%31));
- xnul = 59;ynul = 0;
- RectFill(r,xnul+zijde*i,ynul+zijde*j,xnul+zijde*(i+1),ynul+zijde*(j+1));
- RectFill(r,xnul+zijde*j,ynul+zijde*i,xnul+zijde*(j+1),ynul+zijde*(i+1));
-
- xnul = 259;ynul = 0;
- RectFill(r,xnul-zijde*(i+1),ynul+zijde*j,xnul-zijde*i,ynul+zijde*(j+1));
- RectFill(r,xnul-zijde*(j+1),ynul+zijde*i,xnul-zijde*j,ynul+zijde*(i+1));
-
- xnul = 59;ynul = 200;
- RectFill(r,xnul+zijde*i,ynul-zijde*(j+1),xnul+zijde*(i+1),ynul-zijde*j);
- RectFill(r,xnul+zijde*j,ynul-zijde*(i+1),xnul+zijde*(j+1),ynul-zijde*i);
-
- xnul = 259;ynul = 200;
- RectFill(r,xnul-zijde*(i+1),ynul-zijde*(j+1),xnul-zijde*i,ynul-zijde*j);
- RectFill(r,xnul-zijde*(j+1),ynul-zijde*(i+1),xnul-zijde*j,ynul-zijde*i);
- }
- }
-
- for(k=0;k<10;k++)
- {
- for(j=0;j<20;j++)
- {
- for(i=1;i<32;i++) SetRGB4(vp,i,(i+j)%16,0,16-(i+j)%16);
- Delay(1);
- }
- for(j=19;j>=0;j--)
- {
- for(i=31;i>=1;i--) SetRGB4(vp,i,(i+j)%16,0,16-(i+j)%16);
- Delay(1);
- }
- }
-
- /* ======einde in stijl !====== */
- einde=0;
- while(!einde)
- {
- while((mesg=(struct IntuiMessage *)
- GetMsg(NoBorder->UserPort))==NULL)
- {
-
- for(j=0;j<20;j++)
- {
- for(i=1;i<32;i++) SetRGB4(vp,i,(i+j)%16,0,16-(i+j)%16);
- Delay(1);
- }
- for(j=19;j>=0;j--)
- {
- for(i=31;i>=1;i--) SetRGB4(vp,i,(i+j)%16,0,16-(i+j)%16);
- Delay(1);
- }
- }
-
- ReplyMsg(mesg);
- mclass=mesg->Class;
-
-
- if(mclass==MOUSEBUTTONS)
- {
- einde=1;
-
- SetAPen(r,0);
- SetDrPt(r,0xAAAA);
- for(i=0;i<160;i+=2)
- {
- Move(r,159-i,0);Draw(r,159-i,MAXH);
- Move(r,160+i,0);Draw(r,160+i,MAXH);
- }
- for(i=1;i<160;i+=2)
- {
- Move(r,159-i,0);Draw(r,159-i,MAXH);
- Move(r,160+i,0);Draw(r,160+i,MAXH);
- }
-
- SetDrPt(r,0xffff);
- for(i=0;i<160;i+=2)
- {
- Move(r,159-i,0);Draw(r,159-i,MAXH);
- Move(r,160+i,0);Draw(r,160+i,MAXH);
- }
- for(i=1;i<160;i+=2)
- {
- Move(r,159-i,0);Draw(r,159-i,MAXH);
- Move(r,160+i,0);Draw(r,160+i,MAXH);
- }
-
- CloseWindow(NoBorder);
- CloseScreen(Scrn);
- CloseLibrary(GfxBase);
-
- }
- }
-
- }
- /********************************** einde van main **********************/
-
- VOID OpenALL()
- {
- /*==Intuition==*/
-
- IntuitionBase=(struct IntuitionBase *)
- OpenLibrary("intuition.library",INTUITION_REV);
-
- if(IntuitionBase==NULL)
- exit(FALSE);
-
- /*==Graphics Library==*/
-
- GfxBase=(struct GfxBase *)
- OpenLibrary("graphics.library",GRAPHICS_REV);
-
- if(GfxBase==NULL)
- exit(FALSE);
-
- }
-
-
- PrintAt(rast,x,y,s)
- struct RastPort *rast;
- int x,y;
- char *s;
- {
- Move(rast,x,y);
- Text(rast,s,strlen(s));
- }
-
-